<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div{
      height: 100000000000px;
    }
  </style>
</head>
<body>
  <div ></div>
  <script src="../jquery-1.12.4.min.js"></script>
  <script>
    // 鼠标位置
    $(document).click(function (e) {
      console.log(e.offsetY);
      console.log(e.pageY);
      console.log(e.clientY);//距浏览器左上角
    })

// 键盘按下事件
    $(document).keydown(
      function (e) {
        // 键盘映射编号
        console.log(e.keyCode);
      }
    )
    // 、键盘抬起
    $(document).keyup(
      function (e) {
        console.log(e.keyCode);
      }
    )
  </script>
</body>
</html>